package com.enmonster.session;

import com.enmonster.binding.MyInvocationHandler;

import java.lang.reflect.Proxy;

/**
 * @Author wuxi
 * @create 2019/4/9 下午2:59
 */
public class SqlSession{

        // 获取getMapper
        public static <T> T getMapper(Class<T> clas)
                throws IllegalArgumentException, InstantiationException, IllegalAccessException {
            return (T) Proxy.newProxyInstance(clas.getClassLoader(), new Class[] { clas },new MyInvocationHandler (clas));
        }
}
